home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / PASCAL / ALLSWAGS.ZIP / SWAGN-R.ZIP / NETWORK.SWG / 0044_Nice NETBIOS interface.pas < prev   
Encoding:
Pascal/Delphi Source File  |  1996-11-29  |  22.0 KB  |  649 lines

  1. {
  2. ! Name            : NetBios.Pas
  3. ! Ver             : 0.10
  4. ! (C) Copyright   :
  5. ! Author          : Nicolai Wadström
  6. ! Type of code    : Turbo Pascal 5.0 Unit
  7. ! Date            : 1989-10-xx
  8. !
  9. !----------------------------------------------------------------------------
  10. !
  11. ! Description:
  12. ! ------------
  13. ! NetBios interface routines for Turbo Pascal 4.x, 5.x.
  14. !
  15. !
  16. !
  17. ! History:
  18. ! --------
  19. !
  20. !
  21. !
  22. !
  23. !============================================================================
  24. }
  25. {$A+ Align data + = Word, - = Byte}
  26. {$B- Boolean evaluation + = complete, - = short-circuit}
  27. {$D+ Debug info + = On, - = Off}
  28. {$E- 8087 emulator + = On, - = Off}
  29. {$F- Force far calls + = On, - = Off}
  30. {$I+ IO check + = On, - = Off}
  31. {$L+ Local symbol info + = On, - = Off}
  32. {$N- 8087 code generation + = On, - = Off}
  33. {$O+ Overlay code generation + = On, - = Off}
  34. {$R- Range checking + = On, - = Off}
  35. {$S+ Stack checking + = On, - = Off}
  36. {$V- Var-String checking + = On, - = Off}
  37.  
  38. Unit NetBios;
  39. interface
  40.  
  41. Uses Dos;
  42.  
  43. Const
  44.  {
  45.  ! NetBios commands:
  46.  }
  47.  NetBiosCmd_Call           = $10;
  48.  NetBiosCmd_Listen         = $11;
  49.  NetBiosCmd_HangUp         = $12;
  50.  
  51.  NetBiosCmd_Send           = $14;
  52.  NetBiosCmd_Rec            = $15;
  53.  NetBiosCmd_RecAny         = $16;
  54.  NetBiosCmd_SendChain      = $17;
  55.  
  56.  NetBiosCmd_SendDatagram   = $20;
  57.  NetBiosCmd_RecDatagram    = $21;
  58.  NetBiosCmd_SendBroadcast  = $22;
  59.  NetBiosCmd_RecBroadcast   = $23;
  60.  
  61.  NetBiosCmd_AddName        = $30;
  62.  NetBiosCmd_DeleteName     = $31;
  63.  NetBiosCmd_Reset          = $32;
  64.  NetBiosCmd_AdapterStat    = $33;
  65.  NetBiosCmd_SessionStat    = $34;
  66.  NetBiosCmd_Cancel         = $35;
  67.  NetBiosCmd_AddGroupName   = $36;
  68.  
  69.  
  70.  NetBiosCmd_Unlink         = $70;
  71.  NetBiosCmd_SendNoAck      = $71;
  72.  NetBiosCmd_SendChainNoAck = $72;
  73.  NetBiosCmd_FindName       = $78;
  74.  NetBiosCmd_TokenRingTrace = $79;
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  NetBiosCmdNoWait         = $80;
  82.  
  83.  {
  84.  ! NetBios error codes:
  85.  }
  86.  
  87.  NetBios_Ok               = $00;
  88.  NetBios_IllegalBufLen    = $01;
  89.  NetBios_InvalidCmd       = $03;
  90.  NetBios_Timeout          = $05;
  91.  NetBios_MsgIncomplete    = $06;
  92.  NetBios_InvalidSessionNr = $08;
  93.  NetBios_OutofResources   = $09;
  94.  NetBios_SessionClosed    = $0A;
  95.  NetBios_CmdCanceled      = $0B;
  96.  NetBios_DupLocalName     = $0D;
  97.  NetBios_NameTableFull    = $0E;
  98.  NetBios_Name_Deleted     = $0F;
  99.  NetBios_SessionTableFull = $11;
  100.  NetBios_RemNotListning   = $12;
  101.  NetBios_IvalidNameNr     = $13;
  102.  NetBios_NameNotFound     = $14;
  103.  NetBios_InvalidNameFormat= $15;
  104.  NetBios_NameExists       = $16;
  105.  NetBios_NameDeleted      = $17;
  106.  NetBios_ConnectionLost   = $18;
  107.  NetBios_DupNetworkName   = $19;
  108.  NetBios_BadPacket        = $1A;
  109.  NetBios_InterfaceBusy    = $21;
  110.  NetBios_TooManyCmds      = $22;
  111.  NetBios_InvalidAdapNr    = $23;
  112.  NetBios_CmdNotCanceled   = $24;
  113.  NetBios_InvalidCancelCmd = $26;
  114.  NetBios_AlreadyDefName   = $30; { Name already defined by another envoirment }
  115.  NetBios_EnvNotDef        = $34; { Envoirment not defined, RESET must be issued}
  116.  NetBios_OutOfSysResource = $35; { Required os resources exhausted, retry later}
  117.  NetBios_MaxAPPLExceeded  = $36; { Max. nr of applications eceeded }
  118.  NetBios_OutOfSAPs        = $37; { There is no SAPs available for NetBIOS}
  119.  NetBios_ResourceNotAvail = $38; { Requested resource(s) not available }
  120.  NetBios_InvalidNCB       = $39; { Invalid NCB address or len don' fit in seg}
  121.  NetBios_Illegal_RESET    = $3A; { Reset May not be issued from a NetBios adapter appendage}
  122.  NetBios_InvalidNCB_DD_ID = $3B; { Invalid DeviceDriver ID, OS/2 only }
  123.  NetBios_LockFailed       = $3C; { NetBios attempted to lock user storage but lock failed }
  124.  NetBios_DDOpenErr        = $3F; { Device driver open error, OS/2 only }
  125.  NetBios_OS2error         = $40; { OS/2 error detected, OS/2 only }
  126.  NetBios_HardwareError    = $FE;
  127.  NetBios_NotCompleted     = $FF;
  128.  
  129.  
  130.  
  131.  
  132.  NrOfNCBs                 = 2;
  133.  CurrentNCB               : Byte = 1;
  134.  MaxSessions              = 20;
  135.  NrOfNames                = 254;
  136.  NetBiosNoWait            : Boolean = False;
  137.  
  138. Type
  139.    Str16                  = String[16];
  140.    NameType               = Array[1..16] of Char;
  141.    NodeAddressType        = Array[1..6] of Byte;
  142.    VersionType            = record
  143.                              Major          : Byte;
  144.                              Minor          : Byte;
  145.                             end;
  146.  
  147.    NameEntryType          = record
  148.                              Name           : NameType;
  149.                              NameNumber     : Byte;
  150.                              NameStatus     : Byte;
  151.                              {
  152.                              !                |                         |
  153.                              ! NameStatus     | Meaning                 |
  154.                              !  Bin     | Dec |                         |
  155.                              ! -----421----------------------------------
  156.                              ! 00000000   (0) | Name add in progress.   |
  157.                              ! 00000100   (4) | Active name.            |
  158.                              ! 00000101   (5) | Delete pending.         |
  159.                              ! 00000110   (6) | Improper duplicate name.|
  160.                              ! 00000111   (7) | Duplicate name, delete  |
  161.                              !                | pending.                |
  162.                              ! ------------------------------------------
  163.                              }
  164.                             end;
  165.  
  166.  
  167.    OneSessionStatusType   = record
  168.                              LocSessionNr   : Byte;
  169.                              SessionState   : Byte;
  170.                              {
  171.                              !              |                         |
  172.                              ! SessionState | Meaning                 |
  173.                              ! ----------------------------------------
  174.                              !            1 | Session LISTEN pending. |
  175.                              !            2 | Session CALL pending.   |
  176.                              !            3 | Session active.         |
  177.                              !            4 | HANG UP pending.        |
  178.                              !            5 | HANG UP complete.       |
  179.                              !            6 | Session aborted.        |
  180.                              ! ----------------------------------------
  181.                              }
  182.  
  183.                              LocName        : NameType;
  184.                              RemName        : NameType;
  185.                              RecCmdsOut     : Byte;
  186.                              SendCmdsOut    : Byte;
  187.                             end;
  188.  
  189.    SessionStatusType      = record
  190.                              SessionNr      : Byte;
  191.                              NrOfSessions   : Byte;
  192.                              MessCmdsOut    : Byte;
  193.                              RecAnyCmdsOut  : Byte;
  194.                              SessionTable   : Array[1..MaxSessions] of OneSessionStatusType;
  195.                             end;
  196.  
  197.    SessionStatusPtr       = ^SessionStatusType;
  198.  
  199.  
  200.  
  201.  
  202.    ExtStatusType          = record
  203.                              DIR_INIT_ErrCode       : Word;
  204.                              DIR_OPEN_ADAPErrCode   : Word;
  205.                              LatestNetworkStatus    : Word;
  206.                              LatestPCError          : Word; {Contents of AX reg}
  207.                              LatestOperCommandCode  : Byte;
  208.                              LatestCCBRetCode       : Byte;
  209.  
  210.                              LineErrors             : Word;
  211.                              InternalErrors         : Word;
  212.                              BurstErrors            : Word;
  213.                              ARI_FCI_delimiter      : Word;
  214.                              Abort_delimiter        : Word;
  215.                              LostFrameErrors        : Word;
  216.                              RecCongestion          : Word;
  217.                              FrameCopiedErrors      : Word;
  218.                              FreqErrors             : Word;
  219.                              TokenErrors            : Word;
  220.                              Reserved               : Word;
  221.                              DMABusErrors           : Word;
  222.                              DMAParityErrors        : Word;
  223.                             end;
  224.  
  225.    AdapterStatusType      = record
  226.                              NodeAddress    : NodeAddressType;
  227.                              MajorVersion   : Byte;
  228.                              {
  229.                              ! $00 = Version 1.xx
  230.                              ! $02 = Version 2.xx
  231.                              ! $03 = Version 3.xx
  232.                              !
  233.                              }
  234.  
  235.                              PowerOnResult  : Byte;
  236.                              {
  237.                              ! Always zero in current versions.
  238.                              }
  239.  
  240.                              AdapterType    : Byte;
  241.                              {
  242.                              ! $FF = Token-Ring Network Adapter
  243.                              ! $FE = PC Network Adapter
  244.                              !
  245.                              }
  246.                              MinorVersion   : Byte;
  247.  
  248.                              MinSincePowerUp: Word;
  249.                              {
  250.                              ! Minutes since system was powered up.
  251.                              ! Rolls over to zero when it reaches $FFFF.
  252.                              }
  253.  
  254.                              NrOfCRCErrors  : Word;
  255.                              {
  256.                              ! Number of CRC error on received packets.
  257.                              ! Rolls over to zero when it reaches $FFFF.
  258.                              }
  259.  
  260.                              NrOfAlignErrors:Word;
  261.                              {
  262.                              ! Number of alignment errors.
  263.                              ! Rolls over to zero when it reaches $FFFF.
  264.                              }
  265.  
  266.                              NrOfCollisions : Word;
  267.                              {
  268.                              ! Number of transmit collision errors.
  269.                              ! Rolls over to zero when it reaches $FFFF.
  270.                              }
  271.  
  272.                              NrOfAborted    : Word;
  273.                              {
  274.                              ! Number of aborted transmissions.
  275.                              ! Rolls over to zero when it reaches $FFFF.
  276.                              }
  277.  
  278.                              NrOfTxDPackets : LongInt;
  279.                              {
  280.                              ! Number of packets trasmitted.
  281.                              ! Rolls over to zero when it reaches $FFFFFFFF.
  282.                              }
  283.  
  284.                              NrOfRxDPackets : LongInt;
  285.                              {
  286.                              ! Number of packets received.
  287.                              ! Rolls over to zero when it reaches $FFFFFFFF.
  288.                              }
  289.  
  290.                              NrOfReTxDs     : Word;
  291.                              {
  292.                              ! Number of retransmissions.
  293.                              ! Rolls over to zero when it reaches $FFFF.
  294.                              }
  295.  
  296.                              NrOfEoBufErrs  : Word;
  297.                              {
  298.                              ! Number of times receiver was out of buffers.
  299.                              ! Rolls over to zero when it reaches $FFFF.
  300.                              }
  301.  
  302.                              DLCT1_Timeouts : Word;
  303.  
  304.                              DLCTi_Timeouts : Word;
  305.  
  306.                              ExtStatusPtr   : ^ExtStatusType;
  307.                              NrOfNCBsFree   : Word;
  308.                              NrOfNCBsReseted: Word;
  309.                              MaxResNCBs     : Word;
  310.                              {
  311.                              ! Maximum number of NCBs that can be specified
  312.                              ! by the RESET command.
  313.                              }
  314.  
  315.                              NrOfTxOutOfBuf : Word;
  316.                              MaxDatagramSize: Word;
  317.                              ActSessions    : Word;
  318.                              {
  319.                              ! Number of active or pending sessions.
  320.                              }
  321.  
  322.                              NrOfResSessions: Word;
  323.                              {
  324.                              ! Number of possible sessions specified in
  325.                              ! last RESET command.
  326.                              }
  327.  
  328.                              MaxResSessions : Word;
  329.                              {
  330.                              ! Maximum number of sessions that can be specified
  331.                              ! by the RESET command.
  332.                              }
  333.  
  334.                              NetPacketSize  : Word;
  335.                              {
  336.                              ! Maximum packet size supported by the network
  337.                              }
  338.  
  339.                              NrOfNames             : Word;
  340.                              PermanentName         : NameEntryType;
  341.                              NameTable             : Array[1..NrOfNames] of NameEntryType;
  342.                             end;
  343.  
  344.  
  345.    NCB_Type               = record
  346.                              Command               : Byte;
  347.                              RetCode               : Byte;
  348.                              LocSessionNr          : Byte;
  349.                              NameNr                : Byte;
  350.                              BufferPtr             : Pointer;
  351.                              BufferLen             : Word;
  352.                              Callname              : NameType;
  353.                              Name                  : NameType;
  354.                              Rec_TimeOut           : Byte;
  355.                              Send_TimeOut          : Byte;
  356.                              User_Int              : Pointer;
  357.                              Adapter_Num           : Byte;
  358.                              CmdDone               : Byte;
  359.                              Reserved              : Array[1..14] of Byte;
  360.                             end;
  361.  
  362.    NCB_TypePtr            = ^NCB_TypePtr;
  363.  
  364.    TraceHeaderType        = record
  365.                              TraceBufferPtr         : Pointer;
  366.                              TraceBufferLen         : Word;
  367.                              TraceEntryStart        : Word;
  368.                              CodeChangeLvl          : Array[8..15] of Byte;
  369.                              TraceEntryCounterLo    : Word;
  370.                              TraceEntryCounterHi    : Word;
  371.                              InternBuffersExhaust   : Word;
  372.                              InternTxdBufferExhaust : Word;
  373.                              Reserved               : Array[24..27] of byte;
  374.                              LastTraceEntry         : Word;
  375.                              NextTraceEntry         : Word;
  376.                             end;
  377.  
  378.    TraceEntry             = record
  379.                              AdapterNum             : Byte;
  380.                              XMA3270BankID          : Byte;
  381.                              EntryType              : Byte;
  382.                              Modifier               : Byte;
  383.                              TicksSinceLastEntry    : Word;
  384.                              Data                   : Array[6..31] of Byte;
  385.                             end;
  386.  
  387.  
  388.    NetBIOSHardwareHeader  = record
  389.                              HeaderLength           : Byte;
  390.                              Delimiter              : Word;
  391.                              Command                : Byte;
  392.                              Data1                  : Byte;
  393.                              Data2                  : Word;
  394.                              TxCorrelator           : Word;
  395.                              RespCorrelator         : Word;
  396.                              DestSessionNr          : Byte;
  397.                              SrcSessionNr           : Byte;
  398.                             end;
  399.  
  400. Var
  401.    LocalAdapterStatus     : AdapterStatusType;
  402.    LocalName              : String[16];
  403.  
  404.  
  405. function Call_NetBios(Var NCB:NCB_Type) : Word;
  406. {
  407. ! Calls netbios with a NCB.
  408. !
  409. }
  410.  
  411.  
  412. function NetBIOSErrorStr ( ErrorCode : Word ) : String;
  413. {
  414. ! NetBIOSErrorStr
  415. ! ---------------
  416. !
  417. ! Returns the error code as a explaining strig.
  418. !
  419. !
  420. }
  421.  
  422. function NetBIOSAvailable : Boolean;
  423. {
  424. ! NetBIOSAvailable
  425. ! ----------------
  426. ! Returns true if NetBIOS interface routines can be found otherwise false.
  427. !
  428. }
  429.  
  430.  
  431.  
  432.  
  433. procedure Name2Str(Name:NameType; Var Strng:String);
  434.  
  435. procedure Str2Name(Strng:String; Var Name:NameType);
  436.  
  437. function Reset(Var NCB : NCB_Type) : Word;
  438.  
  439. function Cancel(Var NCB : NCB_Type) : Word;
  440.  
  441. function GetAdapterStat(
  442.                         Var NCB           : NCB_Type;
  443.                         Var Status        : AdapterStatusType
  444.                        ) : Word;
  445.  
  446. function Unlink(Var NCB : NCB_Type) : Word;
  447.  
  448. function AddName(Var NCB : NCB_Type) : Word;
  449.  
  450. function SendBlock(
  451.                    Var NCB         : NCB_Type;
  452.                    Var Buffer
  453.                   ) : Word;
  454.  
  455.  
  456. implementation
  457.  
  458. Var
  459.    NetBiosStatus          : Word;
  460.  
  461.  
  462. function Call_NetBios(Var NCB:NCB_Type) : Word;
  463. {
  464. ! Calls netbios with a NCB.
  465. !
  466. }
  467. Var
  468.   Regs        : Registers;
  469. begin
  470.  Regs.ES:=Seg(NCB);
  471.  Regs.BX:=Ofs(NCB);
  472.   Intr($5C,Regs);
  473.  
  474. {$IFDEF DEBUGING}
  475.    WriteLn(' NetBIOS Msg(',NCB.RetCode ,' dec): ',NetBIOSErrorStr(NCB.RetCode) );
  476. {$ENDIF}
  477.  
  478.  Call_NetBios:=Regs.AX;
  479. end;
  480.  
  481. function NetBIOSErrorStr ( ErrorCode : Word ) : String;
  482. {
  483. ! NetBIOSErrorStr
  484. ! ---------------
  485. !
  486. ! Returns the error code as a explaining strig.
  487. !
  488. !
  489. }
  490. begin
  491.   Case ErrorCode of
  492.    NetBios_Ok               : NetBIOSErrorStr := 'Ok';
  493.    NetBios_IllegalBufLen    : NetBIOSErrorStr := 'Illegal buffer length';
  494.    NetBios_InvalidCmd       : NetBIOSErrorStr := 'Invalid command';
  495.    NetBios_Timeout          : NetBIOSErrorStr := 'Timeout';
  496.    NetBios_MsgIncomplete    : NetBIOSErrorStr := 'Message incomplete';
  497.    NetBios_InvalidSessionNr : NetBIOSErrorStr := 'Invalid session nr';
  498.    NetBios_OutofResources   : NetBIOSErrorStr := 'Out of resources';
  499.    NetBios_SessionClosed    : NetBIOSErrorStr := 'Session closed';
  500.    NetBios_CmdCanceled      : NetBIOSErrorStr := 'Command canceled';
  501.    NetBios_DupLocalName     : NetBIOSErrorStr := 'Duplicate of Localname';
  502.    NetBios_NameTableFull    : NetBIOSErrorStr := 'Nametable full';
  503.    NetBios_Name_Deleted     : NetBIOSErrorStr := 'Name deleted';
  504.    NetBios_SessionTableFull : NetBIOSErrorStr := 'Session table full';
  505.    NetBios_RemNotListning   : NetBIOSErrorStr := 'Remote not listning';
  506.    NetBios_IvalidNameNr     : NetBIOSErrorStr := 'Ivalid name nr';
  507.    NetBios_NameNotFound     : NetBIOSErrorStr := 'Name not found';
  508.    NetBios_InvalidNameFormat: NetBIOSErrorStr := 'Invalid name format';
  509.    NetBios_NameExists       : NetBIOSErrorStr := 'Name exists';
  510.    NetBios_NameDeleted      : NetBIOSErrorStr := 'Name deleted';
  511.    NetBios_ConnectionLost   : NetBIOSErrorStr := 'Connection lost';
  512.    NetBios_DupNetworkName   : NetBIOSErrorStr := 'Dupliacte network name';
  513.    NetBios_BadPacket        : NetBIOSErrorStr := 'Bad packet';
  514.    NetBios_InterfaceBusy    : NetBIOSErrorStr := 'Busy (Try again)';
  515.    NetBios_TooManyCmds      : NetBIOSErrorStr := 'Too Many Commands';
  516.    NetBios_InvalidAdapNr    : NetBIOSErrorStr := 'Invalid adapter nr';
  517.    NetBios_CmdNotCanceled   : NetBIOSErrorStr := 'Command not canceled';
  518.    NetBios_InvalidCancelCmd : NetBIOSErrorStr := 'Invalid cancel command';
  519.    NetBios_HardwareError    : NetBIOSErrorStr := 'Hardware error';
  520.    NetBios_NotCompleted     : NetBIOSErrorStr := 'Not completed';
  521.   end;
  522. end;
  523.  
  524.  
  525. procedure Name2Str(Name:NameType; Var Strng:String);
  526. Var B,B1:Byte;
  527. begin
  528.  B1:=16;
  529.   Strng:=Name;
  530.  
  531.  B1 := 16;
  532.  
  533.  for B:= 16 downto 1 do
  534.   if Name[B]=#0 then B1:=B;
  535.  
  536.  Strng[0]:=Chr(B1);
  537. end;
  538.  
  539. procedure Str2Name(Strng:String; Var Name:NameType);
  540. Var
  541.    B,
  542.    StrLen     : Byte;
  543. begin
  544.  
  545.   for B:= 1 to 16 do Name[B] := #0;
  546.  
  547.    StrLen   := Length(Strng);
  548.  
  549.    if StrLen > 16 then StrLen := 16;
  550.  
  551.   For B := 1 to StrLen do
  552.    Name[B] := Strng[B];
  553.  
  554. end;
  555.  
  556.  
  557.  
  558. function NetBIOSAvailable : Boolean;
  559. {
  560. ! NetBIOSAvailable
  561. ! ----------------
  562. ! Returns true if NetBIOS interface routines can be found otherwise false.
  563. !
  564. }
  565. Var
  566.   Regs               : Registers;
  567.   NCB                : NCB_Type;
  568.   VectorTable        : Array[0..255] of LongInt absolute $0000:$0000;
  569.  
  570. begin
  571.  
  572.   if VectorTable[$5C] = 0 then
  573.    begin
  574.     NetBIOSAvailable     := False;
  575.     Exit;
  576.    end;
  577.  
  578.  
  579.  
  580.    FillChar(NCB, SizeOf(NCB), #0 );
  581.  
  582.   NCB.Command      := $FF;       { Invalid command }
  583.  
  584.   Regs.ES          := Seg(NCB);
  585.   Regs.BX          := Ofs(NCB);
  586.  
  587.    Intr($5C,Regs);
  588.  
  589.  NetBiosAvailable := (NCB.RetCode = NetBios_InvalidCmd);
  590. end;
  591.  
  592. {
  593. !=============================================================================
  594. !                          NetBios function calls.
  595. !
  596. !-----------------------------------------------------------------------------
  597. }
  598.  
  599. function Reset(Var NCB : NCB_Type) : Word;
  600. begin
  601.  NCB.Command:=NetBiosCmd_Reset;
  602.  Reset := Call_NetBios(NCB);
  603. end;
  604.  
  605.  
  606. function Cancel(Var NCB : NCB_Type) : Word;
  607. begin
  608.  NCB.Command:=NetBiosCmd_Cancel;
  609.  Cancel := Call_NetBios(NCB);
  610. end;
  611.  
  612.  
  613. function GetAdapterStat(
  614.                         Var NCB           : NCB_Type;
  615.                         Var Status        : AdapterStatusType
  616.                        ) : Word;
  617. begin
  618.  NCB.Command:=NetBiosCmd_AdapterStat;
  619.   NCB.BufferPtr:= Addr(Status);
  620.   NCB.BufferLen:= SizeOf(Status);
  621.  GetAdapterStat:= Call_NetBios(NCB);
  622. end;
  623.  
  624.  
  625. function Unlink(Var NCB : NCB_Type) : Word;
  626. begin
  627.  NCB.Command  := NetBiosCmd_Unlink;
  628.  Unlink       := Call_NetBios(NCB);
  629. end;
  630.  
  631.  
  632. function AddName(Var NCB : NCB_Type) : Word;
  633. begin
  634.  NCB.Command:=NetBiosCmd_AddName;
  635.  AddName := Call_NetBios(NCB);
  636. end;
  637.  
  638.  
  639. function SendBlock(
  640.                    Var NCB         : NCB_Type;
  641.                    Var Buffer
  642.                   ) : Word;
  643. begin
  644.   NCB.Command     := NetBiosCmd_Send;
  645.   NCB.BufferPtr   := Addr(Buffer);
  646.   SendBlock       := Call_NetBios(NCB);
  647. end;
  648. end.
  649.